#ifndef REDSFML_HPP
#define REDSFML_HPP

/********************************************************************
	created:	2011/01/15
	filename: 	E:\C++\Red\src\Graphics\RedSFML.hpp
	author:		Red
	
	purpose:	Link between Red and SFML
*********************************************************************/

#include "Utils/Color.hpp"
#include "SFML/Graphics.hpp"

namespace red {
	inline sf::Color RedToSFMLColor(const Color &pColor){
		return sf::Color(static_cast<u8>(pColor.R() * 255), 
						 static_cast<u8>(pColor.G() * 255), 
						 static_cast<u8>(pColor.B() * 255),
						 static_cast<u8>(pColor.A() * 255));
	}

	inline Color SFMLToRedColor(const sf::Color &pColor){
		return Color(static_cast<f32>(pColor.r / 255.f), 
					 static_cast<f32>(pColor.g / 255.f), 
					 static_cast<f32>(pColor.b / 255.f), 
					 static_cast<f32>(pColor.a / 255.f));
	}

	template<class T>
	inline sf::Vector2f RedToSFMLVector2F(const Vector2<T> &pVec){
		return sf::Vector2f(static_cast<f32>(pVec.x), static_cast<f32>(pVec.y));
	}

	template<class T>
	inline sf::Vector2i RedToSFMLVector2I(const Vector2<T> &pVec){
		return sf::Vector2i(static_cast<s32>(pVec.x), static_cast<s32>(pVec.y));
	}

	template<class T>
	inline Vector2F SFMLToRedVector2F(const sf::Vector2<T> &pVec){
		return Vector2F(static_cast<f32>(pVec.x), static_cast<f32>(pVec.y));
	}

	template<class T>
	inline Vector2I SFMLToRedVector2I(const sf::Vector2<T> &pVec){
		return Vector2I(static_cast<s32>(pVec.x), static_cast<s32>(pVec.y));
	}
	
}

#endif // REDSFML_HPP